package com.haste.service;

import com.haste.pojo.Dept;
import javafx.geometry.Pos;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @ClassName:DeptClientService
 * @Description:
 * @Author:Haste
 * @Date:2021/2/3 9:39
 */
@FeignClient(value = "PROVIDER-DEPT",fallbackFactory = DeptClientHystrixService.class)
@Component
public interface DeptClientService {
    @GetMapping(value = "/dept/get/{id}")
    Dept queryById(@PathVariable("id") Long id);
    @GetMapping(value = "/dept/list")
    List<Dept> queryAll();
    @PostMapping(value = "/dept/add")
    boolean addDept(@RequestBody Dept dept);
}
